﻿<controls:ChildWindow
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           x:Class="Candy.FamilyEditWindow"
           Width="311" Height="392" 
           Title="FamilyEditWindow" Style="{StaticResource ChildWindowStyleChromeless}">
    <Border Margin="0" Background="{StaticResource ControlBackgroundDark}" BorderBrush="{StaticResource Accent}" BorderThickness="1">
        <Grid x:Name="LayoutRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="10"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Button x:Name="CancelButton" Content="Cancel" Command="{Binding CancelEdit}" Width="75" HorizontalAlignment="Right" Margin="0,12,8,8" Grid.Row="10" />
            <Button x:Name="OKButton" Content="OK" Command="{Binding Save}" Width="75" HorizontalAlignment="Right" Margin="0,12,87,8" Grid.Row="10" />
            <TextBlock HorizontalAlignment="Left" Margin="8,4,0,4" TextWrapping="Wrap" Text="Family Editor" VerticalAlignment="Center" FontSize="{StaticResource HeaderFontSize}"/>
            <TextBox Margin="8,4" Grid.Row="2" TextWrapping="Wrap" Text="{Binding Entity.Name, Mode=TwoWay, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnNotifyDataErrors=True}" VerticalAlignment="Center"/>
            <TextBlock HorizontalAlignment="Left" Margin="8,4,0,4" Grid.Row="1" TextWrapping="Wrap" Text="Name" VerticalAlignment="Center"/>
            <RadioButton IsChecked="{Binding Entity.Type, Mode=TwoWay, Converter={StaticResource FamilyType2BoolConverter}, ConverterParameter=group}" Content="Functional Group" HorizontalAlignment="Left" Margin="8,4,0,4" Grid.Row="4" VerticalAlignment="Center"/>
            <RadioButton IsChecked="{Binding Entity.Type, Mode=TwoWay, Converter={StaticResource FamilyType2BoolConverter}, ConverterParameter=family}" Content="Family" HorizontalAlignment="Left" Margin="8,4,0,4" Grid.Row="5" VerticalAlignment="Center"/>
            <RadioButton IsChecked="{Binding Entity.Type, Mode=TwoWay, Converter={StaticResource FamilyType2BoolConverter}, ConverterParameter=superfamily}" Content="Super Family" HorizontalAlignment="Left" Margin="8,4,0,4" Grid.Row="6" VerticalAlignment="Center"/>
            <TextBlock Text="{Binding Entity.CreateDate, FallbackValue=Created at 01/01/1901, StringFormat=Created at \{0:G\}}" HorizontalAlignment="Left" Margin="8,4,0,4" Grid.Row="8" TextWrapping="Wrap"  VerticalAlignment="Center" FontStyle="Italic" FontSize="12" Opacity="0.6"/>
            <TextBlock Text="{Binding Entity.CreatedBy, FallbackValue=Created by jaha, StringFormat=Created by \{0\}}" HorizontalAlignment="Left" Margin="8,4,0,4" Grid.Row="9" TextWrapping="Wrap"  VerticalAlignment="Center" FontStyle="Italic" FontSize="12" Opacity="0.6"/>
        </Grid>
    </Border>
</controls:ChildWindow>